package com.example.pachong.mapper;

import com.example.pachong.pojo.Users;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface UserMapper {

    @Select("select * from users where uid = #{uid}")
    Users selectByUid(String uid);

    @Insert("insert into users(uid,level,freq,nickname,temp,finallytime,shorttemp) " +
            "value(#{uid},#{level},#{freq},#{nickname},#{temp},#{finallytime},#{shorttemp})")
    void insertUser(Users user);

    @Update("update users set temp = #{temp},freq = #{freq},finallytime = #{finallytime},shorttemp = #{shorttemp} where uid = #{uid}")
    void updateUser(Users user);
}
